package com.thread.singleton;

/**
 * 懒汉式单例
 * 需要的时候在初始化，线程不安全
 */
public class LazySingletonDemo {

    private static LazySingletonDemo lazySingletonDemo ;

    private LazySingletonDemo() {
    }

    public LazySingletonDemo getInstance(){
        if (lazySingletonDemo == null) {
            lazySingletonDemo = new LazySingletonDemo();
        }
        return lazySingletonDemo;
    }
}
